package com.springbootstudy.demo.test;

import org.springframework.stereotype.Component;

@Component()
public class Person {
    private String name="xxx";
    private Integer age=11;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Person() {
    }

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    // 省略 getter setter

    // 后续会省略 toString 方法， 使用 IDE 自动生成就可以了
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void init() {
        System.out.println("init ............");
    }
}
